<template>
  <div>
    <div class="meta-container">
      <a
        href="###"
        target="_blank"
        class="user-message"
      >{{author}}</a>
      <div class="date">{{publishTime}}</div>
      <div class="tag_list">
        <a
          href="###"
          class="tag"
          v-for="(item, index) in tagList"
          :key="'tag' + index + Math.random()"
        >
          {{item}}
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    author: String,
    publishTime: String,
    tagList: Array,
  },
  mounted() {
    console.log(this.author);
  },
};
</script>

<style>
a {
  text-decoration: none;
  cursor: pointer;
  color: #909090;
}

.meta-container {
  display: flex;
  align-items: center;
}
.meta-container .user-message {
  display: flex;
  align-items: center;
  margin-right: 8px;
  max-width: 162px;
  font-size: 13px;
  line-height: 22px;
  color: #4e5969;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}
.user-message:hover {
  color: #007fff;
}
.meta-container .date {
  position: relative;
  padding: 0 10px;
  line-height: 22px;
  font-size: 13px;
  flex-shrink: 0;
  color: #86909c;
}
.meta-container .date:before {
  left: 0;
}
.meta-container .date:before {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 1px;
  height: 14px;
  background: #e5e6eb;
  content: " ";
}
.meta-container .date:after {
  right: 0;
}
.meta-container .date:after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 1px;
  height: 14px;
  background: #e5e6eb;
  content: " ";
}

.tag_list .tag {
  position: relative;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 22px;
  padding: 0 8px;
  color: #86909c;
}
.tag:hover {
  color: #007fff;
}
.tag::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 2px;
  background: #86909c;
  border-radius: 50%;
  position: absolute;
  left: -2px;
  top: 7px;
}
</style>